﻿@{
    Layout = "_LayoutTest";
}



@model IEnumerable<MyMVCDemo.Models.EF.T001好友表>
@using MyMVCDemo.Models.ViewModels.Member;



@{
    ViewData["Title"] = "List";
}

<p>
    @Context.User.FindFirst(System.Security.Claims.ClaimTypes.Name)?.Value
</p>
<p>
    角色:
    @foreach (var claims in Context.User.Claims.Where(c => c.Type == System.Security.Claims.ClaimTypes.Role))
    {
        <span> @claims.Value </span>
    }
</p>


<hr />

<!--此处插入了搜索框-->
@{
    await Html.RenderPartialAsync("Search", new SearchModel());
}
<a asp-action="Create">新建记录</a>
<br />

<table class="table">
    <tr>
        <th>
            name
        </th>
        <th>
            phone
        </th>
    </tr>
    @foreach (var item in Model)
    {
        <tr>
            <td>
                <a asp-action="Detail" asp-route-id="@item.Id">@item.姓名</a>
            </td>
            <td>
                @item.电话
            </td>
        </tr>
    }
</table>

@if (!Model.Any())
{
    <h3>没有相应数据。</h3>
}